package com.jweb.framework.util.log4j.dto;

import java.io.Serializable;

import com.jweb.framework.util.FormatUtil;

public class JLog implements Serializable {
	private static final long serialVersionUID = 6544825008609015389L;

	private String msgId;// 业务流水号
	private String bizCode;// 业务类型
	private String sourcesName;// 来源项目
	private String sourcesIp;// 来源IP
	private String currentName;// 当前项目
	private String currentIp;// 当前IP
	private String msg;// 报文
	private String remark;// 备注
	private Integer type;// 0起点 1中间 2终点

	@SuppressWarnings("unused")
	private JLog() {
	}

	/**
	 * 日志采集对象，使用方法：
	 * log.info(new JLog(xxx).toString());
	 * @param msgId
	 *            业务标示号
	 * @param bizCode
	 *            业务类型
	 * @param sourcesName请求来源
	 * @param sourcesIp请求来源
	 * @param currentName当前应用
	 * @param currentIp当前IP
	 * @param msg请求报文
	 * @param remark
	 *            备注
	 * @param type
	 *            0起点 1途中 2终点
	 */
	public JLog(String msgId, String bizCode, String sourcesName, String sourcesIp, String currentName, String currentIp, String msg, String remark, int type) {
		super();
		this.msgId = msgId;
		this.bizCode = bizCode;
		this.sourcesName = sourcesName;
		this.sourcesIp = sourcesIp;
		this.currentName = currentName;
		this.currentIp = currentIp;
		this.msg = msg;
		this.remark = remark;
		this.type = type;
	}

	@Override
	public String toString() {
		return FormatUtil.toJSONString(this);
	}

	public String getMsgId() {
		return msgId;
	}

	public void setMsgId(String msgId) {
		this.msgId = msgId;
	}

	public String getBizCode() {
		return bizCode;
	}

	public void setBizCode(String bizCode) {
		this.bizCode = bizCode;
	}

	public String getSourcesName() {
		return sourcesName;
	}

	public void setSourcesName(String sourcesName) {
		this.sourcesName = sourcesName;
	}

	public String getCurrentName() {
		return currentName;
	}

	public void setCurrentName(String currentName) {
		this.currentName = currentName;
	}

	public String getSourcesIp() {
		return sourcesIp;
	}

	public void setSourcesIp(String sourcesIp) {
		this.sourcesIp = sourcesIp;
	}

	public String getCurrentIp() {
		return currentIp;
	}

	public void setCurrentIp(String currentIp) {
		this.currentIp = currentIp;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

}
